<script setup>
const emit = defineEmits(["customEvent"]);
const click = () => {
    emit("customEvent", "子组件发送的消息");
};
</script>

<template>
    <div>
        <h1>子组件</h1>
        <p>这是子组件页面</p>
        <button @click="click">发送消息给父组件</button>
    </div>
</template>